package com.yami.shop.live.multishop.controller;

import com.yami.shop.bean.enums.LiveInterfaceType;
import com.yami.shop.common.response.ServerResponseEntity;
import com.yami.shop.live.common.param.LiveUsableNumParam;
import com.yami.shop.live.common.service.LiveLogService;
import com.yami.shop.security.multishop.util.SecurityUtils;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author lhd
 * @date 2020-08-05 08:53:17
 */
@RestController
@RequestMapping("/live/liveRoomProd")
@Tag(name = "商家端直播间商品接口")
public class LiveRoomProdController {

    @Autowired
    private LiveLogService liveLogService;

    @GetMapping("/getAddRoomProdNum")
    @Operation(summary =  "查询商家今日剩余可用添加直播间商品次数")
    public ServerResponseEntity<LiveUsableNumParam> getAddRoomNum() {
        return ServerResponseEntity.success(liveLogService.getLiveNum(SecurityUtils.getShopUser().getShopId(),LiveInterfaceType.IMPORT_ROOM_PROD));
    }
}
